<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>消耗品入库</title>
		<link type="text/css" rel="stylesheet" href="/fontsawesome/css/font-awesome.css"/>
		<link type="text/css" rel="stylesheet" href="/css/style.css"/>
		<style>

			.explain{
				margin-left: 16px;
				font-size: 13px;
				font-weight: bold;
				color: red;
			}
			.titlebtn_box {
				padding-bottom: 17px;
				border-bottom: 1px dashed #ddd;
			}
			.title_top{
				padding-top: 20px;
			}
		</style>
	</head>
	<body>
		<div class="main_box">
			<div class="cont_box editpro_box">
				<form method="post" id="discount_form">
					<ul class="addpro_box">

						<ul class="pay_box clearfix" th:if="${#session.getAttribute('choose')} eq '1'">
							<label>选择商品类型：</label>
							<li class="radio_box">
								<i class="fa fa-circle-thin fa-1x"></i>
								<input type="radio" name="commodityType" value="0"/>
								<span>普通商品</span>
							</li>
							<li class="radio_box">
								<i class="fa fa-circle-thin fa-1x"></i>
								<input type="radio" name="commodityType" value="1"/>
								<span>活动商品</span>
							</li>
							<li class="radio_box">
								<i class="fa fa-circle-thin fa-1x"></i>
								<input type="radio" name="commodityType" value="2"/>
								<span>所有商品</span>
							</li>
						</ul>
						<!-------------------------------------------------------------->
						<!-------------------------------------------------------------->
						<!-------------------------------------------------------------->

						<li th:if="${#session.getAttribute('choose')} eq '2'">
							<label>选择商品类型：</label>
							<select name="typeId">
								<option th:each="t,line : ${#session.getAttribute('typeList')}" th:value="${t?.id}"
										th:text="${t?.stateName}" th:selected="${line.index == '0'}"></option>
							</select>
						</li>

						<li>
							<label>请输入折扣：</label>
							<div class="size">
								<input type="text" placeholder="请输入折扣（1.0 - 9.9）" name="discount" required
									   data-rule-discount="true" data-msg-required="折扣不能为空"/>
							</div>
						</li>
					</ul>
					<div class="probtn_box clearfix titlebtn_box">
						<input type="button" value="提交" class="btn blue_btn submit"/>
					</div>
				</form>

				<div id="explain" class="explain title_top">
					<p>
					* 活动价以销售价格为基准进行打折，请慎重！<br>
					* 如销售价有进行调整过，请参考进货价格。<br>
					* 活动设置只能由店长发起！
					</p>
				</div>
			</div>
		</div>
		<!--javascript include-->
		<script src="/js/jquery-2.2.1.min.js"></script>
		<script src="/js/jquery.dataTables.min.js"></script>
		<script src="/js/bootstrap-datepicker.js"></script>
		<script src="/js/jquery.validate.min.js"></script>
		<script src="/js/jquery.form.min.js"></script>
		<script src="/js/other.js"></script>
		<script th:inline="javascript">
			var userRole = [[${#session.getAttribute("userRole")}]];
			alert(userRole);
			$(function(){
				var instructions = false;
				$("body").other({formId:"#discount_form",formUrl:"/activationRecord/add",userRole:userRole,
					choose:[[${#session.getAttribute('choose')}]],
					instructions:instructions,column:'input[name="commodityType"]:checked'});//formUrl 表单请求地址
			});


		</script>
	</body>
</html>
